<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>对外测试</title>
</head>
<body>
<div style="width:100%">
	<div class="layui-form" lay-filter="projectDeliveryForm" id="projectDeliveryForm">
		<div class="layui-form-item">
			<div class="layui-inline">
				<label class="layui-form-label">搜索</label>
				<div class="layui-input-inline" style="width:300px">
					<input type="text" name="queryString" placeholder="请输入客户名称或者客户地址"
						autocomplete="off" class="layui-input">
				</div>
			</div>

			<div class="layui-inline">
				<button class="layui-btn layuiadmin-btn-list" lay-submit=""
					lay-filter="projectDeliverySearch">
					<i class="layui-icon layui-icon-search"></i>
				</button>
			</div>
		</div>
	</div>
	<table class="layui-hide" id="projectDeliveryTable" lay-filter="projectDeliveryTable"></table>
	 </div>
	<script type="text/javascript">
		var index;
		var form = layui.form;
		var projectDeliveryForm = form.render(null,'projectDeliveryForm');
		
		window.projectDeliveryTable = layui.table;
		var _projectDeliveryTable = window.projectDeliveryTable.render({
			elem : '#projectDeliveryTable',
			url : window.basePath + '/order/findProjectDeliveryByworkNo?workNo=' + window.empCode,
			headers: {"token" : window.token},
			method: "post",
			height : 280,
			cols : [ [ {
				type:'checkbox'
			}
			,{
				field : 'projectNo',
				width : 180,
				title : '项目编号'
			}, {
				field : 'projectName',
				width : 200,
				title : '项目名称'
			}, {
				field : 'contactPerson',
				width : 120,
				title : '客户名称'
			}, {
				field : 'contactTel',
				title : '客户联系电话',
				width : 120
			} , {
				field : 'contactAddress',
				title : '客户地址',
				width : 120
			}] ],
			text : {
				none : '暂无相关数据' //默认：无数据。注：该属性为 layui 2.2.5 开始新增
			},
			page : true
		});
		
		
		projectDeliveryForm.on('submit(projectDeliverySearch)',function(data){
			
			if(data.field.queryString === null || data.field.queryString ===''){
				data.field.queryString='';
			}
			 _projectDeliveryTable.reload({
				where:{
					queryString:data.field.queryString
				},
				page:{
	            	curr:1
	            }
			});
			
			return false;
		});
	</script>
</body>
</html>